package icu.lookyousmileface.netty.simple;


import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.util.CharsetUtil;

import java.nio.charset.Charset;

/**
 * @author shenj
 * @title: Unpooled2
 * @projectName NettyPro
 * @date 2020/12/7 11:00
 */
public class Unpooled2 {
    /**
     * @author shenj
     * @title: main
     * @date 2020/12/7  11:12
     */
    public static void main(String[] args) {

        ByteBuf dataBuf = Unpooled.copiedBuffer("Hello,Your is Lunck!", CharsetUtil.UTF_8);
        System.out.println(new String (dataBuf.array()));
        System.out.println(dataBuf.getCharSequence(1,5, Charset.forName("UTF-8")));
    }
}
